package com.create.abstractd.factory;

/**
 * @author xiaobing
 * @version 1.0
 * @date 2021/9/6 3:23 下午
 */
public class FactoryProducer {
    public static AbstractFactory getAbstractFactory(String key) {
        if ("ShapeFactory".equals(key)) {
            return new ShapeFactory();
        } else if ("ColorFactory".equals(key)) {
            return new ColorFactory();
        } else {
            throw new RuntimeException("数据错误");
        }
    }
}
